<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: member.php 16388 2010-09-06 04:08:21Z liulanbo $
 */

define('APPTYPEID', 0);
define('CURSCRIPT', 'member');

require './source/class/class_core.php';

$discuz = & discuz_core::instance();

//得到地区
$url = explode('.', $_SERVER['SERVER_NAME']);
if ( count($url) != 3 ){
	header("Location: http://www.ttday.com/default.php");
}else if ( count($url) == 3  && $url[0] == 'www' ){
	header("Location: http://www.ttday.com/default.php");
}
$url[0] = mysql_escape_string( $url[0] );
$short = $url[0];
list( $short ) = explode('.', $_SERVER['SERVER_NAME']);
if ( $short != 'www' && !empty( $short ) ){
	include './config/config_global.php';
	include './config/mysql.php';
	include './config/mysql_func.php';
		
	//得到本板块信息
	$sql = "SELECT * FROM `pre_common_district` as d left join `pre_f_a` as f  ON f.aid = d.id where d.level>=2 and d.`url_short` = '{$short}'";
	$rs = mysql_query($sql);
	$local_area = fetch_one( &$rs );
list(,$areaname) = explode(' ',$local_area['name']);
	$strlen = mb_strlen($areaname,'UTF-8');
	if ( strstr( $areaname,'上海' ) ){
		$area_display = "上海";
	}else if ( strstr( $areaname,'北京' ) ){
		$area_display = "北京";
	}else if ( strstr( $areaname,'天津' ) ){
		$area_display = "天津";
	}else if ( strstr( $areaname,'重庆' ) ){
		$area_display = "重庆";
	}else if ( strstr( $areaname,'成都' ) ){
		$area_display = "成都";
	}else if ( strstr( $areaname,'西双版纳' ) ){
		$area_display = "版纳";
	}else if ( strstr( $areaname,'呼和浩特' ) ){
		$area_display = "呼市";
	}else if ( strstr( $areaname,'大兴安岭' ) ){
		$area_display = "兴安";
	}else if ( strstr( $areaname,'齐齐哈尔' ) ){
		$area_display = "齐市";
	}else if ( strstr( $areaname,'鄂尔多斯' ) ){
		$area_display = "鄂市";
	}else if ( strstr( $areaname,'呼伦贝尔' ) ){
		$area_display = "呼伦";
	}else if ( strstr( $areaname,'乌鲁木齐' ) ){
		$area_display = "乌市";
	}else if ( strstr( $areaname,'克拉玛依' ) ){
		$area_display = "克市";
	}else if ( strstr( $areaname,'图木舒克' ) ){
		$area_display = "图市";
	}else if ( strstr( $areaname,'巴音郭楞' ) ){
		$area_display = "巴州";
	}else if ( strstr( $areaname,'博尔塔拉' ) ){
		$area_display = "博州";
	}else if ( strstr( $areaname,'克孜勒苏' ) ){
		$area_display = "克州";
	}else {
		$area_display = $areaname;
	}
	$_G['local_area'] = $local_area;
	$_G['area_display'] = $area_display;	
}else{
	$area_display = '';
}
define('APPTYPEID', 2);
define('CURSCRIPT', 'forum');

$modarray = array('activate', 'clearcookies', 'emailverify', 'getpasswd',
					'groupexpiry', 'logging', 'lostpasswd',
					'register', 'regverify', 'switchstatus');


$mod = !in_array($discuz->var['mod'], $modarray) ? 'register' : $discuz->var['mod'];

define('CURMODULE', $mod);

$modcachelist = array('register' => array('modreasons', 'stamptypeid', 'fields_required', 'fields_optional', 'fields_register', 'ipctrl'));

$cachelist = array();
if(isset($modcachelist[CURMODULE])) {
	$cachelist = $modcachelist[CURMODULE];
}

$discuz->cachelist = $cachelist;
$discuz->init();
if($mod == 'register' && $discuz->var['mod'] != $_G['setting']['regname']) {
	showmessage('undefined_action');
}


runhooks();

require libfile('function/member');
require DISCUZ_ROOT.'./source/module/member/member_'.$mod.'.php';


?>